#ifndef AUDIOFILTER_H
#define AUDIOFILTER_H

#include "FrameFilter.h"

struct AVCodecContext;
struct AVFrame;
struct AVFilterGraph;
struct AVFilterContext;

class AudioFilter: public IFrameFilter
{
public:
    AudioFilter();
    virtual ~AudioFilter();
    bool initFilterGraph(AVRational inTimebase, int inSampleRate, AVSampleFormat inFmt, uint64_t inChannelLayout,
                         int outSampleRate, AVSampleFormat outFmt, uint64_t outChannelLayout, const char* filter_descr);
    AVFrame* filter(AVFrame* frame) override;

    void cleanup();

private:
    AVFilterGraph* filterGraph;
    AVFilterContext* bufferSrcContext;
    AVFilterContext* bufferSinkContext;
};


#endif // AUDIOFILTER_H
